# +----------------------------------------------------------------------
# | Pink [ A modern python web framework ]
# +----------------------------------------------------------------------
# | Copyright (c) 2023 http:#unnnnn.com All rights reserved.
# +----------------------------------------------------------------------
# | Author: chenjianhua <unnnnn@foxmail.com>
# +----------------------------------------------------------------------

import json


class BasePaginator:
    def __iter__(self):
        for result in self.result:
            yield result

    def to_json(self):
        return json.dumps(self.serialize())
